import {ExampleBase} from "../common/example";
import { initializeGL,gl, initShaders } from "../common/webgl";

export class HelloGL implements ExampleBase {
    public init(canvas:HTMLCanvasElement):void {
        if (!initializeGL(canvas)) {
            return;
        }
       
        this.loop()
    }
    public loop() {
        setTimeout(() => {
            this.loop();
        }, 1000 / 60);
        this.draw();
    }
    public draw():void {
        gl.clearColor(0.2, 0.3, 0.4, 1.0);
        gl.clear(gl.COLOR_BUFFER_BIT);
    }
}